home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8194 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1007 b 

  1. Path: news.halcyon.com!usenet
  2. From: normanb@halcyon.com (Norm Bryar)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: visual c++: #undef
  5. Date: Thu, 15 Feb 1996 17:28:03 GMT
  6. Organization: Northwest Nexus Inc.
  7. Message-ID: <4fvqe2$l27@news.halcyon.com>
  8. References: <DMsrJE.7GI@info.uucp>
  9. NNTP-Posting-Host: blv-pm10-ip5.halcyon.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. body2872@mach1.wlu.ca (robert body 9308 u) wrote:
  13.  
  14.  
  15. >my #undefs cause Visual C++ (2.2) to give warnings, yet it fine in 
  16. >Borland C++
  17.  
  18.  
  19. >i use it inside the function with first 
  20. >#define LA
  21. >..code
  22. >#undef LA
  23.  
  24. >or with #define and #undef between functions, and i always the warning 
  25. >that 
  26. >"unexpected characters following #undef; newline expected"
  27. >but there are no unexpected characters there, just
  28. >eg. #undef   ROWCOL(i)
  29.  
  30.  
  31. >--
  32. >body2872@mach1.wlu.ca
  33.  
  34. The macro name is all you need to supply to undef;
  35. the argument list is, indeed, superfluous.
  36.  
  37. #define ARRAYDIM(a)     (sizeof(a)/sizeof(a[0]))
  38.  
  39. func()
  40. {
  41. ...
  42. }
  43.  
  44. #undef ARRAYDIM
  45.  
  46.                 --Norm 
  47.  
  48.  
  49.  
  50.